package com.nexgo.payment.action.online.upload;

import com.nexgo.payment.databases.DataSource;
import com.nexgo.payment.databases.Signature;

import java.util.List;

/**
 * Created by xiaox on 2017/9/14.
 */

/**
 * 上送之前上送失败的电子签名
 */
class UploadEsFailed extends AbsUploadEs {

    UploadEsFailed(DataSource repository) {
        super(repository);
    }

    @Override
    List<Signature> getUploadSignatures() {
        return mRepository.getUploadFailedSignatures();
    }

    @Override
    void updateSignatureUploadState(boolean isUploaded, boolean isUploadSuccessful) {
        super.updateSignatureUploadState(isUploaded, isUploadSuccessful);
        if (isOverMaxReUploadTimes()) {
            //超过最大上送次数当成功处理
            // FIXME: 2017/9/15 这里还要加上打印失败签购单
            super.updateSignatureUploadState(true, true);
        }
    }
}
